Skip to content

Conversation

@michaelokolo
Copy link

@michaelokolo michaelokolo commented Oct 10, 2025

Description

This pull request fixes a bug where the second parameter (fallback value) in the Advanced section of CSS variables is visually removed from the value input field after saving, even though it is correctly stored internally.

Related issue: #5378

Changes

  1. Updated the itemToString function in css-value-input.tsx to correctly handle cases where a fallback value exists.
  2. Implemented a ternary check that:
    • Returns the full variable string when a fallback is present.
    • Returns only the main variable when no fallback exists.

This ensures that the fallback value remains visible in the UI after saving.

How to Test

  1. Open any project.
  2. Navigate to the Advanced section under Style.
  3. Click the plus (+) icon to add a new style.
  4. In the Add styles input, type or select display.
  5. Set the value to: var(--anchor-display, none).
  6. The value remains displayed as var(--anchor-display, none) after saving (previously, the fallback , none would disappear).

open source pix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant